﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>商品列表</title>
    <link rel="icon" href="favicon.ico" type="image/ico">

    <meta name="author" content="yinqi">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/materialdesignicons.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <style type="text/css">
        .c1 {
            float: right;
        }
        tr:hover:not.c2{
            background-color:beige;
            font-family: "楷体";
        }
        .c2{
            background-color: gainsboro;
        }
    </style>
</head>

<body data-logobg="color_8" data-sidebarbg="color_8">
<div class="layout-web">
    <div class="layout-container">
        <c:import url="nav.jsp"></c:import>
        <!--页面主要内容-->
        <main class="layout-content">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="toolbar-btn-action" align="center">
                            <font style="font-family: '楷体';color: brown;font-size: 40px;">xiao mi在售产品列表</font>
                        </div>
                        <div class="card-toolbar clearfix">
                            <form class="pull-right search-bar" method="post" action="commoditysearch.action">
                                <input type="hidden" name="type" value="1"/>
                            <div>
                                   <div class="c1" >
                                       <button type="submit" style="height: 38px;border-radius: 30px;background-color: gainsboro;font-family: '楷体'">搜索</button>
                                   </div>
                                <div class="c1" style="padding-left: 10px;margin-right: 10px">
                                    <input type="search" class="form-control" value="" name="keywords"
                                           placeholder="请输入关键字" style="width: 216px;border-radius: 20px">
                                </div>

                            </div>
                            </form>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr class="c2">
                                        <th style="width: 10%;text-align: center;color:black">产品编号</th>
                                        <th style="width: 20%;text-align: center;color:black">产品型号</th>
                                        <th style="width: 10%;text-align: center;color:black">产品价格</th>
                                        <th style="width: 10%;text-align: center;color:black">生产日期</th>
                                        <th style="width: 10%;text-align: center;color:black">配件供应商</th>
                                        <th style="width: 10%;text-align: center;color:black">系统版本</th>
                                        <th style="width: 10%;text-align: center;color:black">产品类型</th>
                                        <th style="text-align: center;color:black">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="commodity" items="${list}">
                                        <tr>
                                            <td style="text-align: center;color:black;display: block">${commodity.gid}</td>
                                            <td style="text-align: center;color:red;font-family: '楷体';font-size: 20px">${commodity.gname}</td>
                                            <td style="text-align: center;color:green;">${commodity.price}</td>
                                            <td style="text-align: center;color:green;">${commodity.prddate}</td>
                                            <c:forEach var="sup" items="${list1}">
                                                <c:if test="${sup.supid==commodity.supid}">
                                                    <td style="text-align: center;color:green;">${sup.supname}</td>
                                                </c:if>
                                            </c:forEach>

                                            <td style="text-align: center;color:green;">${commodity.model}</td>

                                            <c:forEach var="comm" items="${list2}">
                                                <c:if test="${comm.tyid==commodity.tyid}">
                                                    <td style="text-align: center;color:green;">${comm. tyname}</td>
                                                </c:if>
                                            </c:forEach>


                                            <td style="text-align: center;color:black;">
                                                <div class="btn-group">
                                                    <a class="btn btn-primary m-r-5"
                                                       href="commodityinfo.action?gid=${commodity.gid}"
                                                       title="查看"
                                                       data-toggle="tooltip"
                                                       style="border-radius:40px;background-color:#7373B3"><i
                                                            class="mdi mdi-pencil"></i> 详情</a>

                                                    <a class="btn btn-primary m-r-5"
                                                       href="commodityedit.action?type=1&gid=${commodity.gid}"
                                                       title="更新"
                                                       data-toggle="tooltip" style="border-radius: 20px"><i
                                                            class="mdi mdi-pencil"></i> 产品更新</a>

                                                </div>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

    </div>

    </main>
    <!--End 页面主要内容-->
</div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript">
    $(function () {
        $('.search-bar .dropdown-menu a').click(function () {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>

</html>